// 封装用户相关接口
import request from '@/utils/request'
export const userService_login = (username, password) => {
  return request.post('/api/login', {
    username,
    password
  })
}

export const userService_register = (username, password, repassword) => {
  return request.post('/api/reg', {
    username,
    password,
    repassword
  })
}

// 获取用户基本信息
export const userService_getUserInfo = () => {
  return request.get('/my/userinfo')
}

// 传递参数对象
export const userService_UpdatePwd = (params) => {
  return request.patch('my/updatepwd', params)
}

// 修改用户基本信息
export const userService_updateInfo = (params) => {
  return request.put('/my/userinfo', params)
}

// 更新用户头像
export const userService_updateAvatar = (avatar) => {
  return request.patch('/my/update/avatar', { avatar })
}
